package org.thread.test05.syn.homework.demo04;

/**
 * @author CSY
 * @date 2025 - 03 - 13
 */
public class Printer {
    /**
     * 打印内容 - 打印机
     * @param user 使用者
     * @param msg 内容
     */
    public synchronized void print(String user,String msg){
        try {
            Thread.sleep(500);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.print(user);
        System.out.print(":");
        System.out.print(msg);
    }
}
